package addon.w3.mdx.com;

import java.io.IOException;

import addon.w3.mdx.MDXCOM;
import addon.w3.mdx.LEDataInputStream;
import addon.w3.mdx.MDXException;

/**
--GNDX						// [VertexGroup]
	long	nvgrps;
	byte	vertexGroups[nvgrps];
 * @author madjk
 *
 */
public class MDXVertexGroupCOM extends MDXCOM {
	int length;
	public byte vertexGroup[];
	
	public String getTag() {
		return "GNDX";
	}
	
	public void _decode(LEDataInputStream ins) throws IOException, MDXException {
		length = ins.readInt();
		vertexGroup = new byte[length];
		for (int i = 0; i < vertexGroup.length; i++) {
			vertexGroup[i] = ins.readByte();
		}
	}
	
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("TAG : "+getTag());
		if(vertexGroup != null && vertexGroup.length > 0) sb.append("\n\tVERTEXGROUP[] : "+vertexGroup.length);
		return sb.toString();
	}

	@Override
	public boolean isImplicitTag() {
		// TODO Auto-generated method stub
		return true;
	}
}
